Method and apparatus for detecting liveness based on phase difference

ABSTRACT

A method and apparatus for detecting a liveness based on a phase difference are provided. The method includes generating a first phase image based on first visual information of a first phase, generating a second phase image based on second visual information of a second phase, generating a minimum map based on a disparity between the first phase image and the second phase image, and detecting a liveness based on the minimum map.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.17/017,118 filed on Sep. 10, 2020, which claims the benefit under 35 USC§ 119(a) of Korean Patent Application No. 10-2020-0022858, filed on Feb.25, 2020, in the Korean Intellectual Property Office, the entiredisclosures of which are incorporated herein by reference for allpurposes.

BACKGROUND 1. Field

The following description relates to a method and apparatus fordetecting a liveness based on a phase difference.

2. Description of Related Art

Biometric authentication technology is used to authenticate a user basedon, for example, a fingerprint, an iris, voice, a face or a bloodvessel. Such biological characteristics used for the authenticationdiffer from individual to individual, rarely change during a lifetime,and have a low risk of being stolen or imitated. In addition,individuals do not need to intentionally carry such characteristics atall times. Face verification technology, which is a type of biometricauthentication technology, is authentication technology of determiningwhether a user is a valid user based on a face appearing in a stillimage or a moving image.

The face verification technology may identify a target person to beauthenticated without physical contact with the target person. Recently,due to a convenience and efficiency of the face verification technology,the face verification technology is being widely used in variousapplication fields, for example, a security system, a mobileverification or multimedia data search.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter.

In one general aspect, a liveness detection method based on a phasedifference includes generating a first phase image based on first visualinformation of a first phase sensed by a first pixel group of an imagesensor, generating a second phase image based on second visualinformation of a second phase sensed by a second pixel group of theimage sensor, generating a minimum map based on a disparity between thefirst phase image and the second phase image, and detecting a livenessbased on the minimum map.

The generating of the minimum map may include setting a first baseregion in the first phase image, setting a second base regioncorresponding to the first base region in the second phase image,setting at least one shifted region by shifting the second base regionby a reference shift value, generating difference images based on adifference between an image of the first base region and an image of thesecond base region and a difference between the image of the first baseregion and at least one image of the at least one shifted region, andgenerating the minimum map based on the difference images.

The generating of the minimum map based on the difference images mayinclude selecting a minimum value among corresponding difference valuesat positions that correspond to each other in the difference images, anddetermining a pixel value of the minimum map based on the minimum value.The pixel value of the minimum map may correspond to the minimum valueor correspond to an index of a difference image including the minimumvalue among the difference images.

The detecting of the liveness may include inputting input data includingat least one patch that is based on the minimum map to the at least oneliveness detection model, and detecting the liveness based on an outputof the at least one liveness detection model. The at least one livenessdetection model may include at least one neural network, and the atleast one neural network may be pre-trained to detect a liveness of anobject in input data.

The liveness detection method may further include generating a referenceimage by concatenating the first phase image, the second phase image andthe minimum map. The detecting of the liveness may further includegenerating the at least one patch by cropping the reference image basedon a region of interest (ROI). The at least one patch may include aplurality of patches with different characteristics of the object. Theat least one liveness detection model may include a plurality ofliveness detection models that process input data including theplurality of patches. The detecting of the liveness based on the outputof the at least one liveness detection model may include detecting theliveness by fusing outputs of the plurality of liveness detection modelsin response to an input of the input data.

The liveness detection method may further include generating a referenceimage by concatenating the first phase image, the second phase image andthe minimum map. The detecting of the liveness may include detecting theliveness based on the reference image. The liveness detection method mayfurther include performing preprocessing of the first phase image andthe second phase image. The performing of the preprocessing may includeapplying any one or any combination of downsizing, lens shadingcorrection, gamma correction, histogram matching, and denoising to thefirst phase image and the second phase image.

A first pixel of the first pixel group and a second pixel of the secondpixel group may be located adjacent to each other. The livenessdetection method may further include generating a third phase imagebased on third visual information of a third phase sensed by a thirdpixel group of the image sensor; and generating a fourth phase imagebased on fourth visual information of a fourth phase sensed by a fourthpixel group of the image sensor. When the minimum map is generated, adisparity between the first phase image and the third phase image and adisparity between the first phase image and the fourth phase image maybe further used.

In another general aspect, a liveness detection apparatus based on aphase difference includes a processor, and a memory includinginstructions executable by the processor, wherein in response to theinstructions being executed by the processor, the processor isconfigured to generate a first phase image based on first visualinformation of a first phase sensed by a first pixel group of an imagesensor, to generate a second phase image based on second visualinformation of a second phase sensed by a second pixel group of theimage sensor, to generate a minimum map based on a disparity between thefirst phase image and the second phase image, and to detect a livenessbased on the minimum map.

In another general aspect, an electronic apparatus includes an imagesensor configured to sense first visual information of a first phaseusing a first pixel group and to sense second visual information of asecond phase using a second pixel group, and a processor configured togenerate a first phase image based on the first visual information, togenerate a second phase image based on the second visual information, togenerate a minimum map based on a disparity between the first phaseimage and the second phase image, and to detect a liveness based on theminimum map.

In another general aspect, a electronic liveness detection apparatusbased on a phase difference, the liveness detection apparatus includes amultiphase detection sensor configured to generate a first phase imageby sensing first visual information of a first phase using a first pixelgroup and to generate a second phase image by sensing second visualinformation of a second phase using a second pixel group, a multiphasepatch generator configured to generate a minimum map based on adisparity between the first phase image and the second phase image, anda liveness detector configured to detect a liveness based on the minimummap.

Other features and aspects will be apparent from the following detaileddescription, the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example of an operation of a liveness detectionapparatus.

FIG. 2 illustrates an example of a quadrature phase detection (QPD)image sensor.

FIG. 3 illustrates an example of a difference between two-dimensional(2D) object and a three-dimensional (3D) object that may be detectedbased on phase images.

FIG. 4 illustrates an example of a method of detecting a liveness basedon a phase difference.

FIG. 5 illustrates an example of phase characteristics in each directionin an input image.

FIG. 6 illustrates an example of generating a minimum map.

FIGS. 7A and 7B illustrate examples of shifting a phase image.

FIG. 8 illustrates an example of detecting a liveness using referenceinformation and a liveness detection model.

FIG. 9 illustrates an example of generating a reference image.

FIG. 10 illustrates an example of generating output data using aliveness detection model.

FIG. 11 illustrates an example of generating output data using aplurality of liveness detection models.

FIGS. 12A and 12B are block diagrams illustrating examples of a livenessdetection apparatus.

FIG. 13 is a block diagram illustrating an example of an electronicapparatus.

Throughout the drawings and the detailed description, unless otherwisedescribed or provided, the same drawing reference numerals will beunderstood to refer to the same elements, features, and structures. Thedrawings may not be to scale, and the relative size, proportions, anddepiction of elements in the drawings may be exaggerated for clarity,illustration, and convenience.

DETAILED DESCRIPTION

The following detailed description is provided to assist the reader ingaining a comprehensive understanding of the methods, apparatuses,and/or systems described herein. However, various changes,modifications, and equivalents of the methods, apparatuses, and/orsystems described herein will be apparent after an understanding of thedisclosure of this application. For example, the sequences of operationsdescribed herein are merely examples, and are not limited to those setforth herein, but may be changed as will be apparent after anunderstanding of the disclosure of this application, with the exceptionof operations necessarily occurring in a certain order. Also,descriptions of features that are known in the art may be omitted forincreased clarity and conciseness.

The features described herein may be embodied in different forms, andare not to be construed as being limited to the examples describedherein. Rather, the examples described herein have been provided merelyto illustrate some of the many possible ways of implementing themethods, apparatuses, and/or systems described herein that will beapparent after an understanding of the disclosure of this application.

The following specific structural or functional descriptions areexemplary to merely describe the examples, and the scope of the examplesare not limited to the descriptions provided in the presentspecification. Various changes and modifications can be made thereto bythose of ordinary skill in the art.

Although terms of “first” or “second” are used to explain variouscomponents, the components are not limited to the terms. These termsshould be used only to distinguish one component from another component.For example, a “first” component may be referred to as a “second”component, or similarly, and the “second” component may be referred toas the “first” component within the scope of the right according to theconcept of the disclosure.

As used herein, the singular forms are intended to include the pluralforms as well, unless the context clearly indicates otherwise. It shouldbe further understood that the terms “comprises” and/or “comprising,”when used in this specification, specify the presence of statedfeatures, integers, steps, operations, elements, components or acombination thereof, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

Unless otherwise defined herein, all terms used herein includingtechnical or scientific terms have the same meanings as those generallyunderstood by one of ordinary skill in the art. Terms defined indictionaries generally used should be construed to have meaningsmatching with contextual meanings in the related art and are not to beconstrued as an ideal or excessively formal meaning unless otherwisedefined herein.

Hereinafter, examples will be described in detail with reference to theaccompanying drawings, wherein like reference numerals refer to the likeelements throughout.

FIG. 1 illustrates an example of an operation of a liveness detectionapparatus 100. Referring to FIG. 1, the liveness detection apparatus 100generates, based on visual information of an object 110, a detectionresult 120. The detection result 120 may include information about aliveness. For example, the detection result 120 may indicate whether theobject 110 corresponds to a real user or corresponds to an attacker suchas an image acquired by capturing a user. The detection result 120 maybe used in image-based biometric authentication, for example, faceverification or iris authentication.

The visual information of the object 110 may be expressed through aplurality of phases. An image sensor 130 may sense visual information ofthe plurality of phases and may generate sensor data associated withvisual information of each of the phases. The image sensor 130 maycorrespond to a multiphase detection sensor. For example, the imagesensor 130 may be a two phase detection (2PD) sensor for sensing twotypes of phases, or a quadrature phase detection (QPD) sensor forsensing four types of phases. However, a number of phases sensed by theimage sensor 130 is not limited thereto, and the image sensor 130 maysense various numbers of phases. The image sensor 130 corresponds to a2PD sensor as shown in FIG. 1, and examples in which the image sensor130 corresponds to a 2PD sensor will be described below. However, thisis only for convenience of description, the following description isalso applicable to an example in which the image sensor 130 correspondsto another multiphase detection sensor such as a QPD sensor.

A plurality of pixels included in the image sensor 130 may belong to oneof a first group 1 and a second group 2. First pixels of the first group1 may sense first visual information of a first phase and generate firstsensor data, and second pixels of the second group 2 may sense secondvisual information of a second phase and generate second sensor data. Afirst pixel and a second pixel may be located adjacent to each other.The first pixel and the second pixel located adjacent to each other mayindicate any one or any combination of an example in which there is nopixel between the first pixel and the second pixel in a direction inwhich phase characteristics are distinguished, an example in which thefirst pixels are not consecutively arranged, and an example in which thesecond pixels are not consecutively arranged. Distinguishing of phasecharacteristics will be further described below with reference to FIG.5.

FIG. 2 illustrates an example of a QPD image sensor. Referring to FIG.2, an image sensor 210 may sense four types of phases in a form of agrid by distinguishing the phases. For example, in the image sensor 210,first pixels of a first group 1 may sense first visual information of afirst phase, second pixels of a second group 2 may sense second visualinformation of a second phase, third pixels of a third group 3 may sensethird visual information of a third phase, and fourth pixels of a fourthgroup 4 may sense fourth visual information of a fourth phase.

Referring back to FIG. 1, the liveness detection apparatus 100 maygenerate a first phase image 141 based on the first sensor data, and maygenerate a second phase image 142 based on the second sensor data. Dueto a feature of the image sensor 130, a disparity between the firstphase image 141 and the second phase image 142 may be present, and thedisparity may be used to detect the liveness of the object 110. Forexample, FIG. 3 illustrates an example of a difference betweentwo-dimensional (2D) object and a three-dimensional (3D) object that maybe detected based on phase images. When the 2D object is captured, adisparity may not be detected based on a first phase image and a secondphase image. When the 3D object is captured, a disparity may be detectedbased on a first phase image and a second phase image. For example, adisparity may be detected from a stereoscopic structure, for example, anose of a user.

The liveness detection apparatus 100 may generate a minimum map 150 anda reference image 160 based on the first phase image 141 and the secondphase image 142, and may detect the liveness of the object 110 based onthe minimum map 150 and the reference image. When the object 110corresponds to a real user, a disparity corresponding to a differencebetween the first phase image 141 and the second phase image 142 may bepresent. Due to a structural characteristic of the image sensor 130having a narrow gap between the first pixel of the first group 1 and thesecond pixel of the second group 2, the disparity may not be relativelygreat. The liveness detection apparatus 100 may analyze the above finedisparity based on the minimum map 150 and the reference image, and mayeffectively detect the liveness of the object 110 based on an analysisresult.

The liveness detection apparatus 100 may shift at least one time one ofthe first phase image 141 and the second phase image 142 in a state offixing the other one, and may generate the minimum map 150 based on adifference between the fixed image and the shifted image. For example,the liveness detection apparatus 100 may set a first base region in thefirst phase image 141, may set a second base region corresponding to thefirst base region in the second phase image 142, and may generate atleast one shifted region by shifting the second base region by areference shift value. The liveness detection apparatus 100 may generatedifference images based on a difference between an image of the firstbase region and an image of the second base region and a differencebetween the image of the first base region and an image of the at leastone shifted region.

The liveness detection apparatus 100 may generate the minimum map 150based on the difference images. For example, the liveness detectionapparatus 100 may select a minimum value among corresponding differencevalues that are located at coordinates and that correspond to each otherin the difference images, and may determine a pixel value of the minimummap 150 based on the minimum value. Based on the above scheme, eachpixel value of the minimum map 150 may be determined. A pixel value ofthe minimum map 150 may correspond to a minimum value, or an index of adifference image including a minimum value among the difference images.The minimum map 150 may include minimum values or indices.

The liveness detection apparatus 100 may generate the reference image160 by combining the first phase image 141, the second phase image 142and the minimum map 150, and may detect the liveness of the object 110based on the reference image 160. For example, the liveness detectionapparatus 100 may generate the reference image 160 by concatenating thefirst phase image 141, the second phase image 142 and the minimum map150, and may detect the liveness of the object 110 based on thereference image 160.

The liveness detection apparatus 100 may detect the liveness of theobject 110 using at least one liveness detection model. Each livenessdetection model may include at least one neural network. The livenessdetection apparatus 100 may generate input data of a liveness detectionmodel based on the reference image 160, may input the input data to theliveness detection model, and may detect the liveness of the object 110based on output data of the liveness detection model. At least a portionof the neural network may be implemented as software, hardware includinga neural processor, or a combination of software and hardware.

For example, the neural network may correspond to a deep neural network(DNN), for example, a fully connected network, a deep convolutionalneural network (CNN), or a recurrent neural network (RNN). The DNN mayinclude a plurality of layers. The plurality of layers may include aninput layer, at least one hidden layer, and an output layer.

The neural network may be trained to perform a given operation bymapping input data and output data that are in a nonlinear relationshipbased on deep learning. The deep learning may be a machine learningscheme for solving a given issue from a big data set. The deep learningmay be understood as a process of solving an optimization issue bysearching for a point at which energy is minimized while training aneural network based on prepared training data. Through supervised orunsupervised learning of the deep learning, a structure of the neuralnetwork or a weight corresponding to a model may be obtained, and inputdata and output data may be mapped to each other through the weight.

The neural network may be trained based on training data in a trainingprocess, and may perform an inference operation, for example,classification, recognition or detection of input data in an inferenceprocess. The neural network of the liveness detection model may bepre-trained to detect a liveness of an object in input data. The term“pre-” indicates a state before the neural network is “started”. The“started” neural network indicates that the neural network may be readyfor inference. For example, “start” of the neural network may includeloading of the neural network in a memory, or an input of input data forinference to the neural network after the neural network is loaded in amemory.

FIG. 4 illustrates an example of a method of detecting a liveness basedon a phase difference. Referring to FIG. 4, in operation 410, a livenessdetection apparatus generates phase images based on visual informationof a plurality of phases. For example, the liveness detection apparatusmay receive sensor data from pixel groups that sense visual informationof different phases and may generate the phase images based on thesensor data. Hereinafter, an example in which the phase images typicallyinclude a first phase image and a second phase image will be typicallydescribed.

In operation 420, the liveness detection apparatus performspreprocessing of the phase images. When a liveness is detected from a 2Dimage, preprocessing such as distortion correction is generallyperformed. However, in preprocessing according to examples,preprocessing such as distortion correction may not be performed. Thisis because a shape of an object may desirably be preserved to detect afine disparity, but preprocessing such as distortion correction maychange the shape of the object. In an example, instead of the distortioncorrection, preprocessing including any one or any combination ofdownsizing, lens shading correction, gamma correction, histogrammatching, and denoising may be performed. In another example,preprocessing may not be performed.

In an example, the liveness detection apparatus may apply downsizing tothe phase images and may perform preprocessing such as lens shadingcorrection of the phase images to which the downsizing is applied.Through the downsizing, a computation amount may be reduced. Forexample, the downsizing may be performed in a direction in which phasecharacteristics are not distinguished. Since information associated witha disparity is mainly included in a direction in which phasecharacteristics are distinguished, a loss of information may beminimized in a downsizing process. Also, noise may be removed throughpreprocessing such as lens shading correction or gamma correction, andaccordingly an accuracy of image information may be enhanced.Hereinafter, examples of a downsizing operation will be furtherdescribed with reference to FIG. 5.

FIG. 5 illustrates an example of phase characteristics in each directionin an input image. Referring to FIG. 5, pixels of a first group 1 andpixels of a second group 2 are alternately arranged in a horizontaldirection of an image sensor 510. Accordingly, phase characteristics maybe regarded to be reflected in the horizontal direction. In other words,the phase characteristics may be distinguished based on pixel values inthe horizontal direction. Since the image sensor 510 corresponds to a2PD sensor, the phase characteristics are not distinguished in avertical direction. Thus, to maintain the phase characteristics, aliveness detection apparatus may perform downsizing in a direction inwhich the phase characteristics are not distinguished. For example, theliveness detection apparatus may downsize each of a first phase image521 and a second phase image 522 in the vertical direction.

In this example, the liveness detection apparatus may remove sensingdata of a predetermined row based on a predetermined downsizing ratio,or may perform statistical processing (for example, averaging) ofsensing data of a plurality of rows based on a predetermined downsizingratio, to perform downsizing. For example, the liveness detectionapparatus may perform averaging of sensor data of a first row and sensordata of a second row adjacent to the first row for each column and maydownsize a phase image to ½.

Referring back to FIG. 4, in operation 430, the liveness detectionapparatus generates a minimum map based on a disparity between the phaseimages. As described above, the liveness detection apparatus may shiftat least one time one of the first phase image and the second phaseimage in a state of fixing the other one, and may generate a minimum mapbased on a difference between the fixed image and the shifted image.Examples of generating a minimum map will be further described belowwith reference to FIGS. 6, 7A and 7B.

In operation 440, the liveness detection apparatus detects a livenessbased on the minimum map. In an example, the liveness detectionapparatus may generate a reference image by combining the phase imagesand the minimum map, may input input data corresponding to the referenceimage to a liveness detection model, and may detect the liveness basedon output data of the liveness detection model. For example, theliveness detection apparatus may generate at least one patch by croppingthe reference image based on a region of interest (ROI), and input dataof a detection model may be generated based on the at least one patch.Examples of detecting a liveness will be further described below withreference to FIG. 8.

FIG. 6 illustrates an example of generating a minimum map. Referring toFIG. 6, in operation 610, a liveness detection apparatus performs aphase image shift. As described above, the liveness detection apparatusmay shift at least one time one of a first phase image and a secondphase image in a state of fixing the other one. FIG. 6 illustrates anexample in which the first phase image is fixed and an XN-th phase imageis shifted. In FIG. 6, a numerical number in each pixel of each phaseimage represents a pixel value.

In XN, X indicates that phase characteristics are distinguished in ahorizontal direction, and N represents a number of phases. For example,when a first phase image and a second phase image generated by a 2PDsensor are used, the second phase image may be represented as an X2-thphase image. Hereinafter, an example in which the XN-th phase imagecorresponds to the second phase image is described. The livenessdetection apparatus may set a base region in the first phase image andmay set at least one shifted region in the second phase image. Forexample, the liveness detection apparatus may set shifted regions ofx−1, x0 and x+1 in the second phase image. In this example, x0represents a base region in which shift is not performed.

The base region of the first phase image may be referred to as a “firstbase region”, the base region of the second phase image may be referredto as a “second base region”, and the first base region and the secondbase region may correspond to each other in a position. In “x−1” and“x+1”, − and + represent shift directions and “1” represents a referenceshift value. A base region may be set based on the reference shiftvalue. When the reference shift value is “r”, a shifted region may beset by shifting the base region by “r” in a predetermined direction.Thus, the base region may be set in a range enabling an available spacefor shift to be secured.

The liveness detection apparatus may set at least one shifted region(for example, the shifted region of x−1 and the shifted region of x+1)by shifting the second base region (for example, the shifted region ofx0) by the reference shift value (for example, “1”) in a shiftdirection. The reference shift value may be set to various values, and anumber of shifted regions corresponding to the reference shift value maybe set. For example, the number of shifted regions may be determinedbased on the reference shift value and a number of shift directions.

In an example, when the reference shift value is “1” and when the numberof shift directions is “2” that indicates left and right directions, thenumber of shifted regions may be “2×1+1=3”. In this example, the threeshifted regions may include shifted regions of x−1, x0 and x+1. Inanother example, when the reference shift value is “5” and when thenumber of shift directions is “2” that indicates left and rightdirections, the number of shifted regions may be “2×5+1=11”. In thisexample, the 11 shifted regions may include shifted regions of x−5through x−1, x0, and x+1 through x+5. In still another example, when thereference shift value is “1” and when the number of shift directions is“4” that indicates left, right, up, and down directions, the number ofshifted regions may be “2×1+2×1+1=5”. In this example, the five shiftedregions may include shifted regions of x−1, y−1, xy0, x+1, and y+1.

When a multiphase detection sensor such as a QPD sensor is used, phasecharacteristics may be distinguished in directions other than thehorizontal direction. In an example, as shown in FIG. 7A, the livenessdetection apparatus may shift phase images in a horizontal direction anda vertical direction of a QPD sensor and may determine shifted regionsof each phase image. In an XN-th phase image, shifted regions (forexample, shifted regions of x−1, x0 and x+1) may be determined throughshift in the horizontal direction, similarly to operation 610 of FIG. 6.In a YN-th phase image, shifted regions (for example, shifted regions ofy−1, y0 and y+1) may be determined through shift in the verticaldirection.

In XN and YN, X indicates that phase characteristics are distinguishedin the horizontal direction, and Y indicates that phase characteristicsare distinguished in the vertical direction. Also, N represents a numberof phases. Although the same number of phases are used in the verticaldirection and the horizontal direction as described above, a number ofphases used in the vertical direction and a number of phases used in thehorizontal direction may be different from each other. For example, Nmay be determined based on a number of phases that may be distinguishedby a sensor. In an example of a QPD sensor, N may be “2” and a firstphase image, an X2-th phase image, and a Y2-th phase image may bepresent in the example of FIG. 7A.

In another example, as shown in FIG. 7B, the liveness detectionapparatus may shift phase images in a horizontal direction, a verticaldirection, and a diagonal direction of a QPD sensor and may determineshifted regions of each phase image. In an XN-th phase image, shiftedregions (for example, shifted regions of x−1, x0 and x+1) may bedetermined through shift in the horizontal direction. In a YN-th phaseimage, shifted regions (for example, shifted regions of y−1, y0 and y+1)may be determined through shift in the vertical direction. In a ZN-thphase image, shifted regions (for example, shifted regions of z−1, z0and z+1) may be determined through shift in the diagonal direction. InZN, Z indicates that phase characteristics are distinguished in thediagonal direction, and N represents a number of phases. For example,when N is “2”, a first phase image, an X2-th phase image, a Y2-th phaseimage and a Z2-th phase image may be used in the example of FIG. 7B.

When shifted regions are determined as described above, a differencebetween an image of the base region and an image of each of the shiftedregions may be calculated in operation 620. The liveness detectionapparatus may generate difference images based on a difference between afixed image (for example, an image of the first base region) and ashifted image (for example, an image of a shifted region), and maygenerate a minimum map based on the difference images. For example, theliveness detection apparatus may generate a first difference image basedon a difference between the image of the first base region and an imageof the shifted region of x−1, may generate a second difference imagebased on a difference between the image of the first base region and animage of the shifted region of x0, and may generate a third differenceimage based on a difference between the image of the first base regionand an image of the shifted region of x+1.

The liveness detection apparatus may assign an index value to eachdifference image. For example, the liveness detection apparatus mayassign index values in an order of x−1, x0 and x+1. As shown in FIG. 6,an index value of “0” is assigned to the first difference image, anindex value of “1” is assigned to the second difference image, and anindex value of “2” is assigned to the third difference image. Indexvalues may be assigned in various orders.

A difference image set including the above difference images may begenerated for each phase image. For example, in the example of FIG. 7A,a difference image set of the XN-th phase image and a difference imageset of the YN-th phase image may be generated. In the example of FIG.7B, a difference image set of each of the XN-th phase image, the YN-thphase image, and the ZN-th phase image may be generated.

In operation 630, the liveness detection apparatus generates a minimummap. The liveness detection apparatus may select a minimum value amongcorresponding difference values at positions corresponding to each otherin difference images of a difference image set, and may determine apixel value of the minimum map based on the minimum value. In anexample, in FIG. 6, corresponding difference values located at (1, 1)are “1”, “0” and “6”. Among “1”, “0” and “6”, “0” may be selected as aminimum value. In another example, corresponding difference valueslocated at (2, 2) are “25”, “33” and “30”. Among “25”, “33” and “30”,“25” may be selected as a minimum value. As described above, a minimumvalue may be selected among corresponding difference values, and a pixelof the minimum map based on the minimum value.

The pixel value of the minimum map may correspond to a minimum value, oran index of a difference image including the minimum value among thedifference images. A minimum map including minimum values may bereferred to as a “minimum value map”, and a minimum map includingminimum indices may be referred to as a “minimum index map”. In theabove example, “0” may be selected as a minimum value at (1, 1) and anindex of a difference image including “0” may be “1”. Thus, a pixelvalue at (1, 1) is “0” in the minimum value map, and a pixel value at(1, 1) is “1” in the minimum index map. Also, “25” may be selected as aminimum value at (2, 2), and an index of a difference image including“25” may be “0”. Thus, a pixel value at (2, 2) is “25” in the minimumvalue map, and a pixel value at (2, 2) is “0” in the minimum index map.

As described above, a difference image set of each phase image may begenerated. When phase images associated with a plurality of directionsare present as in the examples of FIGS. 7A and 7B, a minimum map of eachof the phase images may be generated based on a difference image set ofeach of the phase images. For example, in the example of FIG. 7A, aminimum map of each of the XN-th phase image and the YN-th phase imagemay be generated. In the example of FIG. 7B, a minimum map of each ofthe XN-th phase image, the YN-th phase image and the ZN-th phase imagemay be generated.

FIG. 8 illustrates an example of operation 440 of FIG. 4, that is, anoperation of detecting a liveness using reference information and aliveness detection model. Referring to FIG. 8, in operation 810, aliveness detection apparatus generates a reference image byconcatenating phase images and a minimum map. The concatenating maycorrespond to an example of a combination. Hereinafter, examples ofgenerating a reference image is further described with reference to FIG.9.

FIG. 9 illustrates an example of generating a reference image. Referringto FIG. 9, when phase characteristics are distinguished in a horizontaldirection, a reference image may be generated by concatenating a firstphase image, an XN-th phase image (for example, a second phase image)and a minimum map. To fit a size of each image, an image of a first baseregion may be used instead of the first phase image, and an image of asecond base region may be used instead of the XN-th phase image.

When phase characteristics are distinguished in both a horizontaldirection and a vertical direction, an additional phase image and anadditional minimum map may be further concatenated. For example, in theexample of FIG. 7A, a reference image may be generated by concatenatingthe first phase image, the XN-th phase image, the YN-th phase image, afirst minimum map and a second minimum map. In the example of FIG. 7B, areference image may be generated by further concatenating the ZN-thphase image and a third minimum map. The first minimum map may begenerated based on the first phase image and the XN-th phase image, andthe second minimum map may be generated based on the first phase imageand the YN-th phase image. Also, the third minimum map may be generatedbased on the first phase image and the ZN-th phase image.

Also, to fit a size of each image, the image of the first base regionmay be used instead of the first phase image, the image of the secondbase region may be used instead of the XN-th phase image, an image of athird base region may be used instead of the YN-th phase image, and animage of a fourth base region may be used instead of the ZN-th phaseimage. The image of the third base region may represent a regioncorresponding to the first base region in the YN-th phase image, and theimage of the fourth base region may represent a region corresponding tothe first base region in the ZN-th phase image.

Referring back to FIG. 8, in operation 820, the liveness detectionapparatus inputs input data corresponding to the reference image to aliveness detection model. For example, the input data may correspond tothe reference image, or correspond to an image obtained by cropping thereference image. The reference image may be cropped in various versionsbased on an ROI.

For example, the ROI may correspond to a face box. In this example, acrop image corresponding to the face box may be represented by 1t, and acrop image corresponding to m times the face box may be represented bym*t (for example, 2t in case of a crop image corresponding to two timesthe face box). A full-size reference image may be represented by“reduced”. In an example, input data may include the crop images 1t and2t and the reference image reduced. Examples of a liveness detectionmodel will be further described below with reference to FIGS. 10 and 11.

In operation 830, the liveness detection apparatus detects a livenessbased on output data of the liveness detection model. The output datamay include a liveness score. The liveness detection apparatus maycompare the liveness score to a predetermined threshold, to detect aliveness of an object. A detection result may indicate whether theobject corresponds to a real user or corresponds to an attacker such asan image acquired by capturing a user.

FIG. 10 illustrates an example of generating output data using aliveness detection model. Referring to FIG. 10, the liveness detectionmodel generates input data 1030 based on a reference image 1010 and ROIinformation 1020. ROI information may include information about a facebox and may be generated by a face detector. The liveness detectionmodel may generate a patch by cropping the reference image 1010 based onthe ROI information 1020. The input data 1030 may include a patch. Whenthe reference image 1010 includes a plurality of concatenated images, aliveness detection apparatus may generate patches by cropping each ofthe images based on ROI information and may generate the input data 1030by concatenating the patches.

A liveness detection model 1040 may include at least one neural network,and the at least one neural network may be pre-trained to detect aliveness of an object include din input data. Training data may includeinput data and a label. In an example, when the input data correspondsto a real user, the label may have a relatively high liveness score.When the input data corresponds to an attacker such as an image, thelabel may have a relatively low liveness score. The neural network maybe trained based on the above training data to output a liveness scoreof the input data. FIG. 10 illustrates a state in which training of theliveness detection model 1040 is completed.

The liveness detection apparatus may input the input data 1030 to theliveness detection model 1040. In response to an input of the input data1030, the liveness detection model 1040 may output output data 1050. Theoutput data 1050 may include a liveness score. The liveness detectionapparatus may detect a liveness of an object by comparing the livenessscore to a predetermined threshold.

FIG. 11 illustrates an example of generating output data using aplurality of liveness detection models. Referring to FIG. 11, a livenessdetection model generates input data 1130 based on a reference image1110 and ROI information 1120. ROI information may include informationabout a face box. The liveness detection model may generate a pluralityof patches (for example, patches 1t, 2t and reduced) by cropping thereference image 1110 based on the ROI information 1120.

For example, the liveness detection model may generate the patch 1 tcorresponding to the face box and the patch 2t expanded two times theface box. The patch reduced may represent the full size of the referenceimage 1110. A patch (may be denoted by 3t) expanded three times the facebox may also be used instead of the patch reduced. The patches 1t, 2tand reduced may include different characteristics of the object. Forexample, the patch 1t may include a characteristic of a face, the patch2t may include a characteristic of a portion around the face, and thepatch reduced may include a characteristic associated with a backgroundor context. The input data 1130 may include the plurality of patches.

Liveness detection models 1140 may output output data 1150 associatedwith each patch in response to an input of the input data 1130. Forexample, the liveness detection models 1140 may include a first livenessdetection model, a second liveness detection model, and a third livenessdetection model. The first liveness detection model may output outputdata 1150 associated with the patch 1 t, the second liveness detectionmodel may output output data 1150 associated with the patch 2t, and thethird liveness detection model may output output data 1150 associatedwith the patch reduced.

The output data 1150 may include a liveness score associated with eachpatch. A liveness detection apparatus may perform a statisticaloperation (for example, an average operation) based on a liveness scoreassociated with each patch, may compare an operation result to apredetermined threshold, and may detect a liveness of an object. Also,the description provided with reference to FIG. 10 is applicable to theexample of FIG. 11.

FIG. 12A is a block diagram illustrating an example of a livenessdetection apparatus 1200. Referring to FIG. 12A, the liveness detectionapparatus 1200 includes a processor 1210 and a memory 1220. The memory1220 is connected to the processor 1210 and may store instructionsexecutable by the processor 1210, data to be processed by the processor1210, or data processed by the processor 1210. The memory 1220 mayinclude, for example, a non-transitory computer-readable storage medium,for example, a high-speed random access memory (RAM) and/or anon-volatile computer-readable storage medium (for example, at least onedisk storage device, a flash memory device or other non-volatile solidstate memory devices).

The processor 1210 may execute instructions to perform at least one ofthe operations described above with reference to FIGS. 1 through 11. Forexample, the processor 1210 may generate a first phase image based onfirst visual information of a first phase sensed by a first pixel groupof an image sensor, may generate a second phase image based on secondvisual information of a second phase sensed by a second pixel group ofthe image sensor, may generate a minimum map based on a disparitybetween the first phase image and the second phase image, and may detecta liveness based on the minimum map.

FIG. 12B is a block diagram illustrating an example of a livenessdetection apparatus 1250. Referring to FIG. 12B, the liveness detectionapparatus 1250 includes a multiphase detection sensor 1251, a multiphaseimage preprocessor 1252, an ROI detector 1253, a multiphase patchgenerator 1254, and a liveness detector 1255. The multiphase detectionsensor 1251, the multiphase image preprocessor 1252, the ROI detector1253, the multiphase patch generator 1254, and the liveness detector1255 may be implemented as at least one hardware module, at least onesoftware module, and/or a combination thereof.

Operations related to a liveness detection will be described below interms of each of the multiphase detection sensor 1251, the multiphaseimage preprocessor 1252, the ROI detector 1253, the multiphase patchgenerator 1254, and the liveness detector 1255, however, the operationsdo not need to be performed by separated components, such as themultiphase detection sensor 1251, the multiphase image preprocessor1252, the ROI detector 1253, the multiphase patch generator 1254, andthe liveness detector 1255. For example, an operation described as beingperformed by one component may be performed by another component, or theabove operations may be performed by a single integrated component, forexample, the liveness detection apparatus 1250.

The multiphase detection sensor 1251 may sense visual information of aplurality of phases and may generate sensor data associated with visualinformation of each of the phases. For example, the multiphase detectionsensor 1251 may be a 2PD sensor for sensing two types of phases, a QPDsensor for sensing four types of phases, or a sensor for sensing varioustypes of phases. The multiphase detection sensor 1251 may sense visualinformation having different phase characteristics using sensing pixelsthat are located adjacent to each other, and may generate sensor databased on the sensed visual information. Based on the sensor data, phaseimages corresponding to each phase characteristic may be generated.

The multiphase image preprocessor 1252 may perform preprocessing ofphase images. For example, the multiphase image preprocessor 1252 mayperform preprocessing including any one or any combination ofdownsizing, lens shading correction, gamma correction, histogrammatching, and denoising. In an example, the multiphase imagepreprocessor 1252 may not perform preprocessing such as distortioncorrection. This is because a shape of an object may desirably bepreserved to detect a fine disparity, but preprocessing such asdistortion correction may change the shape of the object.

The ROI detector 1253 may detect an ROI in phase images. For example,the ROI may correspond to a face box in each of the phase images. TheROI detector 1253 may specify the ROI based on coordinate informationand/or size information. In an example, phase images may be resized tofit an input size of the ROI detector 1253 and may be input to the ROIdetector 1253.

The multiphase patch generator 1254 may generate a minimum map based onphase images (for example, phase images to which preprocessing isapplied) and may generate a reference image based on the minimum map.For example, the multiphase patch generator 1254 may shift at least onetime at least one of the phase images in a state of fixing one of theother phase images, and may generate at least one minimum map based on adifference between the fixed image and the shifted image. The multiphasepatch generator 1254 may generate a reference image by concatenating thephase images and the at least one minimum map.

The multiphase patch generator 1254 may generate at least one patch bycropping the reference image based on the ROI. The at least one patchmay be used to generate input image of the liveness detector 1255. Forexample, the multiphase patch generator 1254 may generate a patch 1 tcorresponding to a face box and a patch 2t expanded two times the facebox, by cropping the reference image based on the ROI. Also, themultiphase patch generator 1254 may prepare a patch reducedcorresponding to the full size of the reference image. The multiphasepatch generator 1254 may generate input data based on the patches 1t, 2tand reduced. For example, the multiphase patch generator 1254 mayconcatenate each patch and may perform resizing to fit an input size ofthe liveness detector 1255.

The liveness detector 1255 may detect a liveness of an object based onthe input data. For example, the liveness detector 1255 may include atleast one neural network that is pre-trained to detect a liveness of anobject in input data. The at least one neural network may output outputdata including a liveness score in response to an input of the inputdata. The liveness detector 1255 may compare the liveness score to athreshold to detect the liveness of the object.

FIG. 13 is a block diagram illustrating an example of an electronicapparatus 1300. Referring to FIG. 13, the electronic apparatus 1300 maygenerate an input image including an object and may detect a liveness ofthe object in the input image. Also, the electronic apparatus 1300 mayperform biometric authentication (for example, image-based biometricauthentication such as face authentication or iris authentication) basedon the liveness of the object. The electronic apparatus 1300 maystructurally or functionally include the liveness detection apparatus100 of FIG. 1, the liveness detection apparatus 1200 of FIG. 12A, and/orthe liveness detection apparatus 1250 of FIG. 12B.

The electronic apparatus 1300 includes a processor 1310, a memory 1320,a camera 1330, a storage device 1340, an input device 1350, an outputdevice 1360, and a network interface 1370. The processor 1310, thememory 1320, the camera 1330, the storage device 1340, the input device1350, the output device 1360, and the network interface 1370 maycommunicate with each other via a communication bus 1380. For example,the electronic apparatus 1300 may be implemented as at least a portionof, for example, a mobile device such as a mobile phone, a smartphone, apersonal digital assistant (PDA), a netbook, a tablet computer or alaptop computer, a wearable device such as a smartwatch, a smart band orsmart glasses, a computing device such as a desktop or a server, homeappliances such as a television (TV), a smart TV or a refrigerator, asecurity device such as a door lock, or a vehicle such as a smartvehicle.

The processor 1310 may execute instructions and functions in theelectronic apparatus 1300. For example, the processor 1310 may processinstructions stored in the memory 1320 or the storage device 1340. Theprocessor 1310 may perform at least one of the operations describedabove with reference to FIGS. 1 through 12B.

The memory 1320 may store data for detection of a liveness. The memory1320 may include a non-transitory computer-readable storage medium or anon-transitory computer-readable storage device. The memory 1320 maystore instructions that are to be executed by the processor 1310, andalso store information associated with software and/or applications whenthe software and/or applications are being executed by the electronicapparatus 1300.

The camera 1330 may capture a still image, video, or both. For example,the camera 1330 may capture a facial image including a face of a user.In an example, the camera 1330 may provide a 3D image including depthinformation of objects. The camera 1330 may include an image sensor (forexample, a 2PD sensor or a QPD sensor) that detects multiple phases.

The storage device 1340 may include a non-transitory computer-readablestorage medium or a non-transitory computer-readable storage device. Thestorage device 1340 may store data or various models used in a livenessdetection process such as a liveness detection model or a face detector.In an example, the storage device 1340 may store a greater amount ofinformation than that of the memory 1320 for a relatively long period oftime. For example, the storage device 1340 may include magnetic harddisks, optical disks, flash memories, floppy disks or other forms ofnon-volatile memories known in the art.

The input device 1350 may receive an input from a user through atraditional input scheme using a keyboard and a mouse, and through a newinput scheme such as a touch input, a voice input or an image input. Forexample, the input device 1350 may detect an input from a keyboard, amouse, a touchscreen, a microphone or a user, and may include any otherdevice configured to transfer the detected input to the electronicapparatus 1300.

The output device 1360 may provide a user with an output of theelectronic apparatus 1300 through a visual channel, an auditory channel,or a tactile channel. The output device 1360 may include, for example, adisplay, a touchscreen, a speaker, a vibration generator, or otherdevices configured to provide a user with an output. The networkinterface 1370 communicates with an external device via a wired orwireless network.

The apparatuses, units, modules, devices, and other components describedherein are implemented by hardware components. Examples of hardwarecomponents that may be used to perform the operations described in thisapplication where appropriate include controllers, sensors, generators,drivers, memories, comparators, arithmetic logic units, adders,subtractors, multipliers, dividers, integrators, and any otherelectronic components configured to perform the operations described inthis application. In other examples, one or more of the hardwarecomponents that perform the operations described in this application areimplemented by computing hardware, for example, by one or moreprocessors or computers. A processor or computer may be implemented byone or more processing elements, such as an array of logic gates, acontroller and an arithmetic logic unit, a digital signal processor, amicrocomputer, a programmable logic controller, a field-programmablegate array, a programmable logic array, a microprocessor, or any otherdevice or combination of devices that is configured to respond to andexecute instructions in a defined manner to achieve a desired result. Inone example, a processor or computer includes, or is connected to, oneor more memories storing instructions or software that are executed bythe processor or computer. Hardware components implemented by aprocessor or computer may execute instructions or software, such as anoperating system (OS) and one or more software applications that run onthe OS, to perform the operations described in this application. Thehardware components may also access, manipulate, process, create, andstore data in response to execution of the instructions or software. Forsimplicity, the singular term “processor” or “computer” may be used inthe description of the examples described in this application, but inother examples multiple processors or computers may be used, or aprocessor or computer may include multiple processing elements, ormultiple types of processing elements, or both. For example, a singlehardware component or two or more hardware components may be implementedby a single processor, or two or more processors, or a processor and acontroller. One or more hardware components may be implemented by one ormore processors, or a processor and a controller, and one or more otherhardware components may be implemented by one or more other processors,or another processor and another controller. One or more processors, ora processor and a controller, may implement a single hardware component,or two or more hardware components. A hardware component may have anyone or more of different processing configurations, examples of whichinclude a single processor, independent processors, parallel processors,single-instruction single-data (SISD) multiprocessing,single-instruction multiple-data (SIMD) multiprocessing,multiple-instruction single-data (MISD) multiprocessing, andmultiple-instruction multiple-data (MIMD) multiprocessing.

The methods that perform the operations described in this applicationare performed by computing hardware, for example, by one or moreprocessors or computers, implemented as described above executinginstructions or software to perform the operations described in thisapplication that are performed by the methods. For example, a singleoperation or two or more operations may be performed by a singleprocessor, or two or more processors, or a processor and a controller.One or more operations may be performed by one or more processors, or aprocessor and a controller, and one or more other operations may beperformed by one or more other processors, or another processor andanother controller. One or more processors, or a processor and acontroller, may perform a single operation, or two or more operations.

Instructions or software to control a processor or computer to implementthe hardware components and perform the methods as described above arewritten as computer programs, code segments, instructions or anycombination thereof, for individually or collectively instructing orconfiguring the processor or computer to operate as a machine orspecial-purpose computer to perform the operations performed by thehardware components and the methods as described above. In one example,the instructions or software include machine code that is directlyexecuted by the processor or computer, such as machine code produced bya compiler. In another example, the instructions or software includehigher-level code that is executed by the processor or computer using aninterpreter. Programmers of ordinary skill in the art can readily writethe instructions or software based on the block diagrams and the flowcharts illustrated in the drawings and the corresponding descriptions inthe specification, which disclose algorithms for performing theoperations performed by the hardware components and the methods asdescribed above.

The instructions or software to control a processor or computer toimplement the hardware components and perform the methods as describedabove, and any associated data, data files, and data structures, arerecorded, stored, or fixed in or on one or more non-transitorycomputer-readable storage media. Examples of a non-transitorycomputer-readable storage medium include read-only memory (ROM),random-access programmable read only memory (PROM), electricallyerasable programmable read-only memory (EEPROM), random-access memory(RAM), dynamic random access memory (DRAM), static random access memory(SRAM), flash memory, non-volatile memory, CD-ROMs, CD−Rs, CD+Rs,CD−RWs, CD+RWs, DVD-ROMs, DVD−Rs, DVD+Rs, DVD−RWs, DVD+RWs, DVD-RAMs,BD-ROMs, BD-Rs, BD-R LTHs, BD-REs, blue-ray or optical disk storage,hard disk drive (HDD), solid state drive (SSD), flash memory, a cardtype memory such as multimedia card micro or a card (for example, securedigital (SD) or extreme digital (XD)), magnetic tapes, floppy disks,magneto-optical data storage devices, optical data storage devices, harddisks, solid-state disks, and any other device that is configured tostore the instructions or software and any associated data, data files,and data structures in a non-transitory manner and providing theinstructions or software and any associated data, data files, and datastructures to a processor or computer so that the processor or computercan execute the instructions.

While this disclosure includes specific examples, it will be apparent toone of ordinary skill in the art that various changes in form anddetails may be made in these examples without departing from the spiritand scope of the claims and their equivalents. The examples describedherein are to be considered in a descriptive sense only, and not forpurposes of limitation. Descriptions of features or aspects in eachexample are to be considered as being applicable to similar features oraspects in other examples. Suitable results may be achieved if thedescribed techniques are performed in a different order, and/or ifcomponents in a described system, architecture, device, or circuit arecombined in a different manner, and/or replaced or supplemented by othercomponents or their equivalents. Therefore, the scope of the disclosureis defined not by the detailed description, but by the claims and theirequivalents, and all variations within the scope of the claims and theirequivalents are to be construed as being included in the disclosure.

What is claimed is:
 1. A liveness detection method based on a phasedifference, the liveness detection method comprising: generating a firstphase image based on first visual information of a first phase sensed bya first pixel group of an multiphase detection sensor; generating asecond phase image based on second visual information of a second phasesensed by a second pixel group of the multiphase detection sensor; anddetecting a liveness based on a disparity between the first phase imageand the second phase image.
 2. The liveness detection method of claim 1,further comprises: generating a minimum map based on a disparity betweenthe first phase image and the second phase image.
 3. The livenessdetection method of claim 2, wherein the generating of the minimum mapcomprises: setting a first base region in the first phase image; settinga second base region corresponding to the first base region in thesecond phase image; setting at least one shifted region by shifting thesecond base region by a reference shift value; generating differenceimages based on a difference between an image of the first base regionand an image of the second base region and a difference between theimage of the first base region and at least one image of the at leastone shifted region; and generating the minimum map based on thedifference images.
 4. The liveness detection method of claim 3, whereinthe generating of the minimum map based on the difference imagescomprises: selecting a minimum value among corresponding differencevalues at positions that correspond to each other in the differenceimages; and determining a pixel value of the minimum map based on theminimum value.
 5. The liveness detection method of claim 4, wherein thepixel value of the minimum map corresponds to the minimum value orcorresponds to an index of a difference image including the minimumvalue among the difference images.
 6. The liveness detection method ofclaim 1, wherein the detecting of the liveness comprises: inputtinginput data including at least one patch that is based on the disparityto the at least one liveness detection model; and detecting the livenessbased on an output of the at least one liveness detection model, the atleast one liveness detection model comprises at least one neuralnetwork, and the at least one neural network is pre-trained to detect aliveness of an object in input data.
 7. The liveness detection method ofclaim 6, further comprising: generating a reference image based on thefirst phase image, the second phase image and the disparity, wherein thedetecting of the liveness further comprises generating the at least onepatch by cropping the reference image based on a region of interest(ROI).
 8. The liveness detection method of claim 7, wherein the at leastone patch comprises a plurality of patches with differentcharacteristics of the object, the at least one liveness detection modelcomprises a plurality of liveness detection models that process inputdata comprising the plurality of patches, and the detecting of theliveness based on the output of the at least one liveness detectionmodel comprises detecting the liveness by fusing outputs of theplurality of liveness detection models in response to an input of theinput data.
 9. The liveness detection method of claim 1, furthercomprising: generating a reference image based on the first phase image,the second phase image and the disparity, wherein the detecting of theliveness comprises detecting the liveness based on the reference image.10. The liveness detection method of claim 1, further comprising:performing preprocessing of the first phase image and the second phaseimage, wherein the performing of the preprocessing comprises applyingany one or any combination of downsizing, lens shading correction, gammacorrection, histogram matching, and denoising to the first phase imageand the second phase image.
 11. The liveness detection method of claim1, further comprising: generating a third phase image based on thirdvisual information of a third phase sensed by a third pixel group of themultiphase detection sensor; and generating a fourth phase image basedon fourth visual information of a fourth phase sensed by a fourth pixelgroup of the multiphase detection sensor, wherein when a minimum map isgenerated based on the disparity between the first phase image and thesecond phase image, a disparity between the first phase image and thethird phase image and a disparity between the first phase image and thefourth phase image may be used.
 12. A non-transitory computer-readablestorage medium storing instructions that, when executed by a processor,cause the processor to perform the liveness detection method of claim 1.13. A liveness detection apparatus based on a phase difference, theliveness detection apparatus comprising: a processor; and a memorycomprising instructions executable by the processor, wherein in responseto the instructions being executed by the processor, the processor isconfigured to: generate a first phase image based on first visualinformation of a first phase sensed by a first pixel group of anmultiphase detection sensor; generate a second phase image based onsecond visual information of a second phase sensed by a second pixelgroup of the multiphase detection sensor; and detect a liveness based ona disparity between the first phase image and the second phase image.14. The liveness detection apparatus of claim 13, wherein the processoris configured to: set a first base region in the first phase image; seta second base region corresponding to the first base region in thesecond phase image; set at least one shifted region by shifting thesecond base region by a reference shift value; generate differenceimages based on a difference between an image of the first base regionand an image of the second base region and a difference between theimage of the first base region and at least one image of the at leastone shifted region; and generate a minimum map based on the differenceimages.
 15. The liveness detection apparatus of claim 14, wherein theprocessor is configured to select a minimum value among correspondingdifference values at positions that correspond to each other in thedifference images and to determine a pixel value of the minimum mapbased on the minimum value.
 16. The liveness detection apparatus ofclaim 13, wherein the processor is configured to generate a referenceimage based on the first phase image, the second phase image and thedisparity and to detect the liveness based on the reference image. 17.The liveness detection apparatus of claim 13, wherein a first pixel ofthe first pixel group and a second pixel of the second pixel group arelocated adjacent to each other.
 18. An electronic apparatus comprising:an multiphase detection sensor configured to sense first visualinformation of a first phase using a first pixel group and to sensesecond visual information of a second phase using a second pixel group;and a processor configured to generate a first phase image based on thefirst visual information, to generate a second phase image based on thesecond visual information, and to detect a liveness based on a disparitybetween the first phase image and the second phase image.
 19. Theelectronic apparatus of claim 18, wherein the processor is configuredto: set a first base region in the first phase image; set a second baseregion corresponding to the first base region in the second phase image;set at least one shifted region by shifting the second base region by areference shift value; generate difference images based on a differencebetween an image of the first base region and an image of the secondbase region and a difference between the image of the first base regionand at least one image of the at least one shifted region; and generatea minimum map based on the difference images.
 20. The electronicapparatus of claim 19, wherein the processor is configured to select aminimum value among corresponding difference values at positions thatcorrespond to each other in the difference images and to determine apixel value of the minimum map based on the minimum value.